<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>订单管理 - 积分订单</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 积分订单 </h3>
        <ul class="page-breadcrumb breadcrumb">        	
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 订单管理 <i class="icon-angle-right"></i> </li>
          <li>积分订单</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    <div class="row">
      <div class="col-md-12">
        <div class="portlet box">
          <div class="booking-search">
            <form action="" role="form" method="get">
              <div class="row form-group">              
                <div class="col-md-4">                  
                  <div class="input-cont">
                    <input class="form-control" name="keyword" placeholder="订单号/收货人姓名" value="<?=$_GET['keyword'];?>" type="text">
                  </div>
                </div>
                <div class="col-md-2">                  
                  <select class="form-control" name="stat">
                    <option value="">订单状态</option>
                    <?php
					if($this->c['stat']['jifen_order_stat']){
						foreach($this->c['stat']['jifen_order_stat'] as $k=> $r){
							if(isset($this->data['para']['stat']) && $k==$this->data['para']['stat']) $slk = ' selected';
							else $slk = '';
							?>
                                <option value="<?=$k;?>"<?=$slk;?>><?=$r;?></option>
                            <?
						}
					}
					?>
                 </select>
                </div>                
                <div class="col-md-2"><input type="submit" class="btn blue btn-block" value="搜 索"></div>
              </div>
              
            </form>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN SAMPLE TABLE PORTLET-->                  
        <div class="portlet box blue">
          <div class="portlet-title">
            <div class="caption"><i class="icon-list"></i>列表(<?=$this->data['count'];?>)</div>
            <div class="tools"> <a href="javascript:;" class="collapse"></a> </div>
          </div>
          <div class="portlet-body">
            <div class="table-scrollable">
             <table class="table table-striped table-bordered table-hover dataTable">
              <thead>
                <tr>
                  <th>订单号</th>
                  <th>下单时间</th>
                  <th>头像</th>
                  <th>昵称</th>
                  <th>收货人</th>
                  <th>商品名称</th>
                  <th>积分</th>
                  <th>订单状态</th>
                  <th>操作</th>
                </tr>
              </thead>
 <tbody>
              <?php
			if($this->data['data'])
			{
				foreach($this->data['data'] as $k=> $r){										
					
					if($this->data['user'][$r['uid']]['headimgurl']!=""){
						
						 $headimg = str_replace("/0","/64",$this->data['user'][$r['uid']]['headimgurl']);	
						
					}
					else $headimg = '/style/assets/img/avatar.png';
											
			?>
                <tr>
                  <td><?=$r['order_id'];?></td>
                  <td><?=date("Y-m-d H:i",$r['add_time']);?></td>
                  <td><img src="<?=$headimg;?>" width="45" height="45"></td>
                  <td>[<?=$r['uid'];?>]<?=stripslashes($this->data['user'][$r['uid']]['nickname']);?></td>
                  <td><?=$r['consignee'];?></td>
                  <td><?=$r['goods_name'];?></td>
                  <td><?=$r['jifen'];?></td>
                  <td><?=$this->c['stat']['jifen_order'][$r['stat']];?></td>        
                  <td><a href="jifen_detail?order_id=<?=$r['order_id'];?>" class="btn btn-xs blue"><i class="icon-eye-open"></i> 查看</a></td>
                </tr>
                <?
					}
				}
				?>
				 </tbody>                                
            </table>
            </div>
          </div>
        </div>
        <?php
		if($this->data['maxpage'] > 1){
		?>
        <div>
          <ul class="pagination">
            <?
			$pquery="?";		
			if($this->data['para']){			
				foreach($this->data['para'] as $k=>$r){				
					$pquery.=$k."=".$r."&";
				}			
			}
			
			if($this->data['page'] > 1) echo '<li><a href="'.$pquery.'page='.($this->data['page']-1).'"><i class="icon-angle-left"></i></a></li>';
			for($i = $this->data['spage']['ps']; $i<=$this->data['spage']['pe']; $i++){
			if($i == $this->data['page']) echo '<li class="disabled"><a href="javascript:void(0);">'.$i.'</a></li>';
			else echo '<li><a href="'.$pquery.'page='.$i.'">'.$i.'</a></li>';
			}
			
			if($this->data['page'] < $this->data['maxpage']) echo '<li><a href="'.$pquery.'page='.($this->data['page']+1).'"><i class="icon-angle-right"></i></a></li>';
			?>
          </ul>
        </div>
        <?
 		}
?>
        <!-- END SAMPLE TABLE PORTLET--> 
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script>
		jQuery(document).ready(function() {    
		   App.init();
		});
	</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>